//解密
var {Decrypt}=require('../secret/index.js')
//分离出地址中的用户名
module.exports=function(req){
	var token=req.headers['x-token-shitian'] || false;
	if(!token){
		data={
			Grade:'',
			name:'',
			state:400,
			_id:null
		}
		return data;
	}
	var username=Decrypt(token).split('-');
	var data={
		Grade:username[0],
		name:username[1],
		state:200,
		_id:username[3]
	}
	if(!token){
		data={
			Grade:'',
			name:'',
			state:400,
			_id:null
		}
	}
	return data;
}